from django.conf.urls.defaults import *
from django.views.generic import DetailView, ListView
from exams.models import Exam



# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$',
        ListView.as_view(
            queryset=Exam.objects.order_by(),
            context_object_name='latest_exam_list',
            template_name='index.html')),
    url(r'^(?P<pk>\d+)/$',
        DetailView.as_view(
            model=Exam,
            template_name='detail.html')),

    # Examples:
    # url(r'^$', 'YourSchool.views.home', name='home'),
    # url(r'^YourSchool/', include('YourSchool.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
